import { getDate } from "./lib/time.mjs";
import { query, del, insert, update } from "./lib/DbUtil.mjs";

insert(
	"insert into `cmd`(key_id,val_1,val_2,val_3,cmd_time) values(?,?,?,?,?)",
	[-1, 0, 0, 0, getDate(true)],
	(res, fields) => {
		console.info("插入完毕");
	}
);
update("update `cmd` set val_1=? where key_id=?", [1062, -1], (res, fields) => {
	console.log("更新成功");
});
query("select * from `cmd`", (data, fields) => {
	console.log("查询结果", data);
});
del("delete from `cmd` where key_id=? ", [-1], () => {
	console.info("删除成功");
});

setTimeout(() => {
	process.exit(0);
}, 3000);
